<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="详情"></u-navbar> -->

		<view class="font-12 pl-2 pt-2 text-999999">来源：{{ source }}</view>
		<view class="font-12 pl-2 pt-2 text-999999">标题：{{ title }}</view>
		<view class="font-12 pl-2 pt-2 text-999999">时间：{{ time }}</view>
		<view class="pl-2 pr-2 mt-6 pb-2">
				<view class="mt-3 text-center font-16 font-weight-bolder pb-2">{{ title }}</view>
			<!-- <rich-text :nodes="richText"></rich-text> -->
			<u-parse :html="richText"></u-parse>
		</view>
	</view>
</template>

<script>
	import $H from "@/common/free-lib/request.js";

	export default {
		data() {
			return {
				time: undefined,
				source: undefined,
				richText: '',
			};
		},
		onLoad(option) {
			this.getPolicyRelease(option.id);
		},
		computed: {
			richTextNodes() {
				return this.parseHTML(this.htmlContent);
			},
		},
		methods: {
			getPolicyRelease(id) {
				$H.get(
					"/basisInform/policyRelease/queryById", {
						id,
					}, {}
				).then((res) => {
					if (!res.result) {
						uni.showToast({
							title: "未查询到相关信息",
							icon: "none",
						});
						return;
					}
					this.time = res.result.releaseTime;
					this.richText = res.result.content;
					this.source = res.result.source;
					this.title = res.result.title;
				});
			},
		},
	};
</script>

<style>
</style>